package com.changgou.goods.dao;

import com.changgou.goods.pojo.Sku;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.mockito.stubbing.ValidableAnswer;
import tk.mybatis.mapper.common.Mapper;

/**
 * sku通用mapper
 * @author zhengjd
 * @date 2020/5/5 23:03
 */
public interface SkuMapper extends Mapper<Sku> {

    @Update("update tb_sku set num=num-#{num} where id = #{id} and num>=#{num}")
    int deCount(@Param(value = "id") Long id, @Param(value = "num") Integer num);
}
